﻿using Microsoft.AspNetCore.Mvc;
using yunbo.Model.SM;
using yunbo.Repositorys.FPMRepositorys;

namespace yunbo.Controllers.SMControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class WMS_CCPRKController : Controller
    {
        WMS_CCPRKRepository _wms_ccprkRepository = new WMS_CCPRKRepository();
        [HttpGet("GetCCPRK")]
        public IActionResult GetCCPRK(int PageNumber, int PageSize)
        {
            var fYCXWMS_CCPRK = _wms_ccprkRepository.FYWMS_CCPRK(PageNumber, PageSize);
            return Ok(fYCXWMS_CCPRK);
        }
        [HttpPost("AddCCPRK")]
        public IActionResult AddCCPRK(WMS_CCPRK wMS_CCPRK)
        {
            wMS_CCPRK.create_time = DateTime.Now;
            wMS_CCPRK.cprk_zt = 1;
            bool ll = _wms_ccprkRepository.AddWMS_CCPRK(wMS_CCPRK) > 0;
            return Ok(ll);
        }
        [HttpPut("UpdateWMS_CCPRK")]
        public IActionResult UpdateWMS_CCPRK(string code)
        {
            bool zt = _wms_ccprkRepository.UpZt(code) > 0;
            return Ok(zt);
        }
    }
}
